package com.zqq.goods.service.repository

import com.zqq.baselibrary.http.RetrofitFactory
import com.zqq.baselibrary.http.rx.BaseResp
import com.zqq.goods.service.api.CategoryApi
import com.zqq.goods.service.bean.Category
import com.zqq.goods.service.bean.GetCategoryReq
import rx.Observable
import javax.inject.Inject

/**
 * 商品分类 网络访问数据层
 * wc
 * @author zqq on 2018/8/1
 */
class CategoryRepository @Inject constructor(){

    /**
     * 1.获取商品分类
     */
    fun getCategory(parentId: Int): Observable<BaseResp<MutableList<Category>?>> {
        return RetrofitFactory.instance
                .create(CategoryApi::class.java)
                .getCategory(GetCategoryReq(parentId))
    }

}